package com.topone.Utils.wx.handler;


import com.topone.service.WechatService;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import me.chanjar.weixin.mp.bean.result.WxMpUser;
import org.springframework.beans.factory.annotation.Autowired;

public abstract class AbstractUserBindHandler extends AbstractHandler {

    @Autowired
    private WechatService wechatService;

    protected WxMpXmlOutMessage subcribe(WxMpService wxMpService, WxMpUser user, WxMpXmlMessage wxMessage) {
        WxMpXmlOutMessage message = null;
        wechatService.saveWechat(user);
        return message != null ? message : buildTextOutMessage("欢迎关注fanZone聚汇平台", wxMessage);
    }

    protected void unSubscribe(WxMpUser user) {
    }

}
